<%@page import="com.hellodoctor.slayer.model.Profile"%>
<%@ include file="/html/common/init.jsp"%>
<%
	ResultRow row = (ResultRow) request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
	Profile doctor = (Profile) row.getObject();
	
	String popup = "javascript:popup('" + doctor.getProfileId() + "');";
%>
<portlet:renderURL var="appointmentURL" windowState="<%= LiferayWindowState.POP_UP.toString() %>">
<portlet:param name="jspPage" value="/html/appointment/makeAppointment.jsp" />
</portlet:renderURL>
	<liferay-ui:icon image="edit" message="Take an appointment"
		url="<%= popup %>" />

<aui:script>
function popup(profileId){
	AUI().use('aui-dialog', function(A) {
		Liferay.Util.openWindow({
			dialog: {
			centered: true,
			modal: true,
			width: 600,
			height: 500
			},
			id: '<portlet:namespace />appointmentPopup',
			title: Liferay.Language.get('Appointment'),
			uri: '<%= appointmentURL %>&<portlet:namespace/>profileId='+ profileId 
		});
}); 
}
</aui:script>
